package dao.connection;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

class MysqlDBConnection extends DBConnection {

	@Override
	public Connection connectDB() {
		try {
			Class.forName("com.mysql.jdbc.Driver");
                        Connection connection =
                                DriverManager.getConnection("jdbc:mysql://localhost:3306/chat", "root", "root");
			return connection;
		} catch (SQLException ex) {
            Logger.getLogger(MysqlDBConnection.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		return null;
	}
        
         public static void main(String[] args) {

//        try {
//            Class.forName("com.mysql.jdbc.Driver");
//            try {
//                com.mysql.jdbc.Connection con = (com.mysql.jdbc.Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/chat", "root", "root");
//            } catch (SQLException ex) {
//                
//            }
//        } catch (ClassNotFoundException ex) {
//            
//        }
    }

	}

